@import url('./var.less');

.ant-spin {
  line-height: 1;
  .ant-spin-dot {
    display: block;
  }
}

.ant-input {
  border-radius: 6px;
  &[type='password'] {
    letter-spacing: 4px;
    &::placeholder {
      letter-spacing: normal;
    }
  }
}

/*---------------------
        btn
---------------------*/

.ant-btn {
  border-radius: 6px;

  & > .ant-btn-loading-icon .anticon {
    display: block;
  }

  &:hover {
    color: #fff;
    border-color: transparent;

    &::before {
      opacity: 1;
    }
  }

  &::before {
    display: block;
    content: ' ';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(45, 48, 51, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
  }
}

.ant-btn-primary {
  background-color: var(--r-blue-default, #7084ff);
  border-color: var(--r-blue-default);
  &:hover,
  &:focus {
    background-color: var(--r-blue-default, #7084ff);
    border-color: var(--r-blue-default, #7084ff);
    box-shadow: 0px 8px 16px rgba(134, 151, 255, 0.3);
  }

  &[disabled],
  &[disabled]:hover,
  &[disabled]:focus,
  &[disabled]:active {
    color: var(--r-neutral-title-2, #fff);
    background-color: var(--r-blue-disable, rgba(219, 224, 255, 1));
    border-color: var(--r-blue-disable, rgba(219, 224, 255, 1));
  }
}
/*---------------------
        message
---------------------*/
.ant-message {
  top: 55px;
  z-index: 1500;
  &:has(.toast-message-2025-center) {
    top: 50%;
    transform: translateY(-50%);
  }
}
.ant-message-notice-content {
  padding: 8px 12px;
  background: rgba(45, 48, 51, 0.95);
  border-radius: 2px;
  .ant-message-custom-content {
    display: flex;
    align-items: center;
  }
  .ant-message-success {
    color: #27c193;
    font-size: 12px;
    line-height: 16px;
    .icon-success {
      width: 12px;
      height: 12px;
      margin-right: 10px;
    }
  }
  .ant-message-error {
    color: #fff;
    & > span {
      word-break: break-all;
    }
  }
}
.toast-message-2025 .ant-message-notice-content {
  display: inline-flex;
  justify-content: center;
  padding-top: 8px;
  padding-bottom: 8px;
  align-items: center;
  border-radius: 2px;
  background: var(--r-neutral-black, #000);

  .anticon {
    top: 0;
  }

  .anticon + span {
    line-height: 1;
    font-size: 13px;
    font-weight: 400;
    color: var(--r-neutral-title-2, #fff);
  }
}

/*---------------------
        modal
---------------------*/
.ant-modal-mask {
  background-color: var(--rabby-custom-ant-modal-mask);
}
.ant-modal-header,
.ant-modal-content,
.ant-modal-content {
  background: @color-bg;
}

.rabby-modal {
  .ant-modal-header,
  .ant-modal-content {
    background-color: #fff;
  }
  .ant-modal-header {
    border-bottom: 0;
  }
}

.modal-bg-white {
  .ant-modal-content {
    background: white;
  }
}

.modal-support-darkmode,
.modal-support-darkmode.ant-modal-confirm-error,
.modal-support-darkmode.rabby-modal {
  .ant-modal-header,
  .ant-modal-content,
  .ant-modal-content {
    background: var(--r-neutral-bg-1, #3d4251);
  }

  .ant-modal-confirm-body .ant-modal-confirm-content {
    // background-color: var(--r-neutral-card-2, rgba(255, 255, 255, 0.06));
    // background: var(--r-neutral-bg-1, #3D4251);
  }

  .ant-modal-confirm-title,
  .ant-modal-confirm-body .ant-modal-confirm-title,
  .ant-modal-confirm-body .ant-modal-confirm-content {
    color: var(--r-neutral-title-1, #f7fafc);
  }

  .ant-modal-close-x .anticon-close svg {
    color: var(--r-neutral-foot, #6a7587);
  }
}

.ant-modal-content {
  border: 1.5px solid var(--r-neutral-line);
  border-radius: 6px;
  overflow: hidden;

  .ant-modal-close-x {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.ant-modal-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 23px;
  text-align: center;

  color: var(--r-neutral-title-1);
}
.ant-modal-header {
  padding-bottom: 0;
}
.ant-modal-confirm-body {
  .anticon.anticon-info-circle,
  .anticon.anticon-exclamation-circle {
    display: none;
  }
  .ant-modal-confirm-title {
    text-align: center;
    font-weight: 500;
    font-size: 20px;
    line-height: 23px;
    text-align: center;

    color: var(--r-neutral-title-1);
  }
  .ant-modal-confirm-content {
    margin-top: 20px;
    color: var(--r-neutral-body);
    background-color: var(--r-neutral-bg-1);
    padding: 18px 12px;
    border-radius: 6px;
    margin-left: 0 !important;
    white-space: pre-wrap;
  }
}

.ant-modal-confirm-body-wrapper {
  .ant-modal-confirm-btns {
    display: flex;
    justify-content: space-between;
    width: 100%;
    .ant-btn {
      min-width: 144px;
      font-size: 15px;
      font-weight: 500;
      height: 44px;
    }
  }
}
.ant-modal-confirm.single-btn {
  .ant-modal-confirm-btns {
    justify-content: center;
  }
}

.ant-modal {
  .ant-modal-body {
    max-height: 500px;
    overflow: auto;
    overflow: -moz-scrollbars-none;
    &::-webkit-scrollbar {
      display: none !important;
    }
  }
  .ant-drawer-body {
    &::-webkit-scrollbar {
      display: none !important;
    }
  }
}

.ant-modal-confirm-error {
  .ant-modal-content {
    background: var(--r-neutral-bg-1, #fff);
  }
  .anticon-close-circle {
    display: none;
  }
  .ant-modal-confirm-btns {
    justify-content: center;
  }
}

.ant-modal-confirm-info {
  .ant-modal-confirm-content {
    max-height: 365px;
    overflow: auto;
  }
}

/*---------------------
        form
---------------------*/
.ant-form-item {
  margin-bottom: 32px;
  &.ant-form-item-with-help {
    margin-bottom: 0;
  }
}
.ant-form-item-explain,
.ant-form-item-extra {
  font-size: 12px;
  line-height: 12px;
  margin-top: 8px;
}

.ant-form-item-control-input {
  min-height: 14px;
}

/*---------------------
        Switch
---------------------*/
.ant-switch {
  background: #b4bdcc;

  &.ant-switch-small {
    height: 14px;
    line-height: 14px;
    .ant-switch-handle {
      top: 1px;
      left: 1px;
    }

    &.ant-switch-checked .ant-switch-handle {
      left: calc(100% - 12px - 1px);
    }
  }
}

.ant-switch-disabled {
  background: rgba(180, 189, 204, 0.3);
}

.ant-switch-checked {
  background-color: #27c193;
}

/*---------------------
      Checkbox
---------------------*/
.ant-checkbox {
  border-radius: 100%;
  overflow: hidden;
  .ant-checkbox-inner {
    border: none;
    background-color: @color-border;
  }
}

.ant-checkbox-checked {
  .ant-checkbox-inner {
    background-color: var(--r-blue-default, #7084ff);
  }
  &::after {
    border-color: var(--r-blue-default, #7084ff);
  }
}

/*---------------------
      Input
---------------------*/
.ant-input {
  line-height: 1;

  &.border-bright-on-active {
    &:active,
    &:focus,
    &:hover {
      border-color: var(--r-blue-default);
    }
  }
}

textarea {
  resize: none;
}

/*---------------------
      Popover
---------------------*/
.ant-popover-inner {
  border-radius: 6px;
}

.ant-popover-arrow {
  box-shadow: none !important;
}

/*---------------------
      Tooltip
---------------------*/
.ant-tooltip:not(.disable-ant-overwrite) {
  max-width: 360px;
  .ant-tooltip-inner {
    font-size: 12px;
    border-radius: 14px;
    padding: 6px 12px;
    background-color: black;
  }
  .ant-tooltip-arrow-content {
    background-color: black;
  }
  .ant-tooltip-arrow {
    display: none;
  }
  &.rectangle {
    max-width: 350px;
    .ant-tooltip-inner {
      border-radius: 2px;
    }
    .ant-tooltip-arrow {
      display: block;
    }
  }
  &.hide-arrow {
    .ant-tooltip-arrow {
      display: none !important;
    }
  }

  &.rounded-tooltip {
    .ant-tooltip-inner {
      border-radius: 2px !important;
    }
    .ant-tooltip-arrow {
      display: block !important;
    }
  }
  &.address-tooltip.address-tooltip-light {
    .ant-tooltip-inner {
      background: var(--r-neutral-bg1);
      color: var(--r-neutral-title1);
    }

    .ant-tooltip-arrow {
      border-color: var(--r-neutral-bg1);
    }

    .ant-tooltip-arrow-content {
      background-color: var(--r-neutral-bg1);
    }
  }
  &.address-tooltip.address-tooltip-transparent {
    .ant-tooltip-inner {
      background: transparent;
    }

    .ant-tooltip-arrow {
      border-color: transparent;
    }

    .ant-tooltip-arrow-content {
      background-color: transparent;
    }
  }
}

/*---------------------
      Dropdown
---------------------*/
.ant-dropdown-menu-root {
  border-radius: 6px;
}

.ant-skeleton-element {
  line-height: 1;
}

.ant-skeleton-element .ant-skeleton-input {
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(216, 223, 235, 0.55) 0%,
    rgba(216, 223, 235, 0.6) 95.31%
  );
}

/*---------------------
      Drawer
---------------------*/
.ant-drawer {
  .ant-drawer-content {
    border-top: 1.5px solid var(--r-neutral-line);
  }
  .ant-drawer-close {
    font-size: 19px;
    line-height: 0;
  }
  .ant-drawer-body {
    padding: 20px 20px 24px;
  }
  .ant-drawer-close {
    color: var(--r-neutral-foot);
  }
  .ant-drawer-close:focus,
  .ant-drawer-close:hover {
    color: var(--r-neutral-body);
  }
  &.disable-body-scroll {
    .ant-drawer-wrapper-body,
    .ant-drawer-body {
      overflow: hidden;
    }
  }
}
.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper {
  box-shadow: none;
}

.ant-slider {
  margin: 0;
  .ant-slider-rail {
    background-color: #e5e9ef;
  }
  .ant-slider-track {
    background-color: #b4bdcc;
  }
  .ant-slider-handle {
    border-color: #b4bdcc;
    transition: box-shadow 0.3s;
  }
  &:hover {
    .ant-slider-handle,
    .ant-slider-handle:not(.ant-tooltip-open) {
      border-color: #b4bdcc;
      box-shadow: 0px 2px 6px rgba(28, 31, 53, 0.2);
    }
    .ant-slider-rail {
      background-color: #e5e9ef;
    }
    .ant-slider-track {
      background-color: #b4bdcc;
    }
  }
}

.field.field-outlined {
  background: @color-bg;
  border-radius: 6px;
  padding: 16px 12px;

  font-weight: 400;
  font-size: 14px;
  line-height: 18px;
  color: @color-title;
  border: 1px solid transparent;

  &:hover {
    background-color: rgba(134, 151, 255, 0.2);
    border: 1px solid var(--r-blue-default, #7084ff);
  }
}

.perps-bridge-swap-modal-dark {
  .ant-modal-content {
    border: 1.5px solid #505562 !important;
  }
}

.perps-bridge-swap-modal {
  .ant-modal-body {
    // border: transparent !important;
    border-radius: 16px;
    background-color: var(--r-neutral-bg-2, #f5f6fa) !important;
  }

  .ant-modal-confirm-btns {
    display: none !important;
  }

  .ant-modal-confirm-content {
    padding: 0 !important;
    background-color: var(--r-neutral-bg-2, #f5f6fa) !important;
  }
}

.perps-edit-tp-sl-modal,
.perps-close-all-position-modal {
  .ant-modal-content {
    border-radius: 16px;
  }

  .ant-modal-body {
    border-radius: 12px;
  }

  .ant-modal-confirm-content {
    margin-top: 0;
  }
  
}




.desktop-swap-token-modal {
  .ant-modal-body {
    max-height: 600px;
    padding: 0;
    width: 100%;
    background: transparent;
    border-radius: 20px;
    overflow: visible;
    &::-webkit-scrollbar {
      display: none !important;
    }
  }
  .ant-modal-content {
    border-radius: 8px;
    border-radius: 20px;
    overflow: visible;
  }

  .js-rabby-desktop-swap-container {
    position: relative;
    overflow: hidden;
    width: 100% !important;
    height: 600px;
    transform: translateX(0);

    .ant-drawer-bottom {
      position: absolute;
    }
    .ant-drawer-mask {
      border-radius: 8px;
    }
    .custom-popup {
      .ant-drawer-content {
        border-radius: 8px;
      }
    }
  }
}
.whitelist-guard-bordered-view {
  bottom: -6px;
  right: -6px;
}

html[desktop] {
  .ant-switch {
    background: var(--r-neutral-line, #e0e5ec);

    &:focus {
      box-shadow: none !important;
    }
  }

  .ant-switch-checked {
    background: var(--r-green-default, #27c193);
  }
}
